import pandas as pd
import plotly.graph_objects as go
import plotly.io as pio

# 创建一个简单的 Plotly 图表
fig = go.Figure(data=go.Scatter(x=[1, 2, 3], y=[4, 5, 6]))
df = pd.read_csv('df_macro.csv', index_col=0)
df = df.iloc[-4:,:2]
# 定义保存路径和文件名
fig = go.Figure(
            data=[go.Bar(x=df.index, y=df[col], name=col) for col in df.columns],
        )
fig.write_image('plot/plot.png')